package cn.sx.dao;

/*
 *@program:sx_emall_ssm
 *@author: sx
 *@desc:类目信息dao
 *@Time: 2020/10/13  19:39
 */

import cn.sx.entity.Items;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import java.util.List;

public interface ItemsDao {

    @Select("select * from items where order_id=#{orderId}")
    List<Items>selectList(int orderId);
    @Insert("insert into items(price,amount,order_id,good_id)values(#{price},#{amount},#{orderId},#{goodId})")
    @SelectKey(keyProperty = "id",statement = "SELECT LAST_INSERT_ID()",before = false,resultType = Integer.class)
    void insert(Items items);
}
